<body class="blue"><div id="HomePageView" class="ZurmoDefaultPageView ZurmoPageView PageView"><div id="ZurmoDefaultView"><div class="GridView"><div id="HeaderView"><!-- Start of themes/default/templates/HeaderView.xhtml --><div id="MainLogo" class="zurmo-logo"></div>
<div class="GridView"><div id="HeaderLinksView"><div class="clearfix"><a href="#" id="nav-trigger" title="Toggle Navigation">&rsaquo;</a><div id="corp-logo"><a href="/zurmo/app/index.php/home/default"><img src="/zurmo/app/themes/default/images/Zurmo_logo.png" alt="Zurmo Logo" height="32" width="107" /></a></div><div id="user-toolbar" class="clearfix"><div id="header-game-dashboard-link-wrapper" class="user-menu-item"><a id="header-game-dashboard-link" href="#">∂</a></div><ul id="user-header-menu" class="user-menu-item nav">
<li class="parent last"><a href="javascript:void(0);"><span>super</span></a>
<ul>
<li><a href="/zurmo/app/index.php/users/default/profile"><span>My Profile</span></a></li>
<li><a href="/zurmo/app/index.php/gamification/default/leaderboard"><span>Leaderboard</span></a></li>
<li><a href="/zurmo/app/index.php/emailMessages/default/matchingList"><span>Data Cleanup</span></a></li>
<li class="last"><a href="/zurmo/app/index.php/zurmo/default/logout"><span>Sign out</span></a></li>
</ul>
</li>
</ul><ul id="settings-header-menu" class="user-menu-item nav">
<li class="parent last"><a href="javascript:void(0);"><span>Administration</span></a>
<ul>
<li><a href="/zurmo/app/index.php/configuration"><span>Administration</span></a></li>
<li><a href="/zurmo/app/index.php/designer/default"><span>Designer</span></a></li>
<li><a href="/zurmo/app/index.php/import/default"><span>Import</span></a></li>
<li><a href="/zurmo/app/index.php/users/default"><span>Users</span></a></li>
<li><a href="http://www.zurmo.com/needSupport.php"><span>Need Support?</span></a></li>
<li class="last"><a href="/zurmo/app/index.php/zurmo/default/about"><span>About Zurmo</span></a></li>
</ul>
</li>
</ul></div></div></div><div class="GridView"><div id="GlobalSearchAndShortcutsCreateMenuView"><div id="app-search" class="clearfix"><select class="ignore-style" id="globalSearchScope" multiple="multiple" style="display:none;" size="4" name="globalSearchScope[]">
<option value="All" selected="selected">All</option>
<option value="accounts">Accounts</option>
<option value="contacts">Contacts</option>
<option value="leads">Leads</option>
<option value="opportunities">Opportunities</option>
</select><input class="global-search global-search-hint" onfocus="$(this).removeClass(&quot;global-search-hint&quot;); $(this).val(&quot;&quot;);" onblur="$(this).val(&quot;&quot;)" id="globalSearchInput" type="text" value="Search by name, phone, or e-mail" name="globalSearchInput" /><span class="z-spinner"></span></div><ul id="ShortcutsMenu" class="nav">
<li class="parent last"><a href="javascript:void(0);"><span>Create</span></a>
<ul>
<li><a href="/zurmo/app/index.php/accounts/default/create"><span>Account</span></a></li>
<li><a href="/zurmo/app/index.php/contacts/default/create"><span>Contact</span></a></li>
<li><a href="/zurmo/app/index.php/conversations/default/create"><span>Conversation</span></a></li>
<li><a href="/zurmo/app/index.php/leads/default/create"><span>Lead</span></a></li>
<li><a href="/zurmo/app/index.php/missions/default/create"><span>Mission</span></a></li>
<li><a href="/zurmo/app/index.php/opportunities/default/create"><span>Opportunity</span></a></li>
<li><a href="/zurmo/app/index.php/reports/default/selectType"><span>Report</span></a></li>
<li class="last"><a href="#" id="yt0"><span>Task</span></a></li>
</ul>
</li>
</ul></div></div></div>



<!-- End of themes/default/templates/HeaderView.xhtml --></div><div class="AppContainer clearfix GridView"><div class="AppNavigation clearfix GridView"><div id="MenuView"><ul class="nav">
<li id="home" class="active"><a href="/zurmo/app/index.php/home/default"><span></span><em></em><span>Home</span></a></li>
<li id="mashableInbox"><a href="/zurmo/app/index.php/mashableInbox/default"><span></span><em></em><span>Inbox<span class="unread-inbox-count">1</span></span></a></li>
<li id="accounts"><a href="/zurmo/app/index.php/accounts/default"><span></span><em></em><span>Accounts</span></a></li>
<li id="leads"><a href="/zurmo/app/index.php/leads/default"><span></span><em></em><span>Leads</span></a></li>
<li id="contacts"><a href="/zurmo/app/index.php/contacts/default"><span></span><em></em><span>Contacts</span></a></li>
<li id="opportunities"><a href="/zurmo/app/index.php/opportunities/default"><span></span><em></em><span>Opportunities</span></a></li>
<li id="marketing" class="hidden-nav-item"><a href="/zurmo/app/index.php/marketing/default/dashboardDetails"><span></span><em></em><span>Marketing</span></a></li>
<li id="projects" class="hidden-nav-item"><a href="/zurmo/app/index.php/projects/default/dashboardDetails"><span></span><em></em><span>Projects</span></a></li>
<li id="products" class="hidden-nav-item"><a href="/zurmo/app/index.php/products/default"><span></span><em></em><span>Products</span></a></li>
<li id="reports" class="hidden-nav-item last"><a href="/zurmo/app/index.php/reports/default"><span></span><em></em><span>Reports</span></a></li>
</ul><a class="toggle-hidden-nav-items"></a></div><div id="RecentlyViewedView"><h3>Recently Viewed</h3></div></div><div class="AppContent HomeTitleBarAndDashboardView GridView"><div class="TitleBarView"><h1>Dashboard</h1></div><div id="HomeDashboardView" class="clearfix DashboardView PortletFrameView MetadataView"><div class="view-toolbar-container clearfix"><nav class="pillbox clearfix"><div id="CreateDashboardLinkActionElement-1-yt1" class="default-button">
<a class="button-action" href="/zurmo/app/index.php/home/default/createDashboard"><i class="icon-create"></i><span class="button-label">Create Dashboard</span></a></div><div id="EditDashboardLinkActionElement-1-yt2" class="default-button">
<a class="button-action" href="/zurmo/app/index.php/home/default/editDashboard?id=1"><i class="icon-edit"></i><span class="button-label">Edit Dashboard</span></a></div><div class="default-button"><a id="AddPortletLink" href="#"><i class="icon-add"></i><span class="button-label">Add Portlet</span></a></div></nav></div><div class="juiportlet-columns"> 
<ul class="juiportlet-columns-HomeDashboard1 juiportlet-widget-column1 juiportlet-column juiportlet-column-split-even-2">
<li class="juiportlet-widget MyUpcomingMeetingsCalendarView type-meetings" id="HomeDashboard1_1">
<div class="juiportlet-widget-head">
<h3>My Upcoming Meetings</h3><ul class="options-menu edit-portlet-menu nav">
<li class="parent last"><a href="javascript:void(0);"><span></span></a>
<ul>
<li class="last"><a class="remove-portlet" href="#"><span>Remove Portlet</span></a></li>
</ul>
</li>
</ul>
</div>
<div class="juiportlet-widget-content"  >
<div id="MyUpcomingMeetingsCalendarView" class="UpcomingMeetingsCalendarView CalendarView ModelView ConfigurableMetadataView MetadataView"><div id="calendarHomeDashboard1_1_container"></div><input id="calendarSelectedDateHomeDashboard1_1" style="display:none;" type="text" name="calendarSelectedDateHomeDashboard1_1" /></div>
</div>
</li>
<li class="juiportlet-widget AllLatestActivitiesForPortletView type-activities" id="HomeDashboard1_2">
<div class="juiportlet-widget-head">
<h3>Latest Activities</h3><ul class="options-menu edit-portlet-menu nav">
<li class="parent last"><a href="javascript:void(0);"><span></span></a>
<ul>
<li class="last"><a class="remove-portlet" href="#"><span>Remove Portlet</span></a></li>
</ul>
</li>
</ul>
</div>
<div class="juiportlet-widget-content"  >
<div id="AllLatestActivitiesForPortletView" class="LatestActivitiesForPortletView ConfigurableMetadataView MetadataView"><div class="AllLatestActivitiesListView LatestActivitiesListView ListView ModelView ConfigurableMetadataView MetadataView"><form id="latest-activity-configuration-form" action="/zurmo/app/index.php/home/default" method="post">
<div style="display:none"><input type="hidden" value="53a68de046f4818cf4ce2afe7394e014015d46c7" name="YII_CSRF_TOKEN" /></div><div class="horizontal-line latest-activity-toolbar"><div id="LatestActivitiesConfigurationForm_ownedByFilter_area"><strong>View</strong>:<input id="ytLatestActivitiesConfigurationForm_ownedByFilter" type="hidden" value="" name="LatestActivitiesConfigurationForm[ownedByFilter]" /><input id="LatestActivitiesConfigurationForm_ownedByFilter_0" value="user" checked="checked" type="radio" name="LatestActivitiesConfigurationForm[ownedByFilter]" /><label for="LatestActivitiesConfigurationForm_ownedByFilter_0">Mine</label><input id="LatestActivitiesConfigurationForm_ownedByFilter_1" value="all" type="radio" name="LatestActivitiesConfigurationForm[ownedByFilter]" /><label for="LatestActivitiesConfigurationForm_ownedByFilter_1">Everyone</label></div><a id="filter-latest-activities-link" href="#">Filters</a></div>
<div id="filter-portlet-model-bar-AllLatestActivitiesForPortletView" class="filter-portlet-model-bar" style="display:none"><div id="LatestActivitiesConfigurationForm_filteredByModelName_area"><input id="ytLatestActivitiesConfigurationForm_filteredByModelName" type="hidden" value="" name="LatestActivitiesConfigurationForm[filteredByModelName]" /><input id="LatestActivitiesConfigurationForm_filteredByModelName_0" value="all" checked="checked" type="radio" name="LatestActivitiesConfigurationForm[filteredByModelName]" /><label for="LatestActivitiesConfigurationForm_filteredByModelName_0">All Activities</label><input id="LatestActivitiesConfigurationForm_filteredByModelName_1" value="Conversation" type="radio" name="LatestActivitiesConfigurationForm[filteredByModelName]" /><label for="LatestActivitiesConfigurationForm_filteredByModelName_1">Conversations</label><input id="LatestActivitiesConfigurationForm_filteredByModelName_2" value="EmailMessage" type="radio" name="LatestActivitiesConfigurationForm[filteredByModelName]" /><label for="LatestActivitiesConfigurationForm_filteredByModelName_2">Emails</label><input id="LatestActivitiesConfigurationForm_filteredByModelName_3" value="Meeting" type="radio" name="LatestActivitiesConfigurationForm[filteredByModelName]" /><label for="LatestActivitiesConfigurationForm_filteredByModelName_3">Meetings</label><input id="LatestActivitiesConfigurationForm_filteredByModelName_4" value="Mission" type="radio" name="LatestActivitiesConfigurationForm[filteredByModelName]" /><label for="LatestActivitiesConfigurationForm_filteredByModelName_4">Missions</label><input id="LatestActivitiesConfigurationForm_filteredByModelName_5" value="Note" type="radio" name="LatestActivitiesConfigurationForm[filteredByModelName]" /><label for="LatestActivitiesConfigurationForm_filteredByModelName_5">Notes</label><input id="LatestActivitiesConfigurationForm_filteredByModelName_6" value="Task" type="radio" name="LatestActivitiesConfigurationForm[filteredByModelName]" /><label for="LatestActivitiesConfigurationForm_filteredByModelName_6">Tasks</label></div></div>
</form><div class="cgrid-view type-activities" id="list-viewAllLatestActivitiesForPortletView">

<table class="items">
<tbody>
<tr><td colspan="1" class="empty"><span class="empty"><span class="icon-empty"></span>No results found</span></td></tr>
</tbody>
</table>
<div class="pager horizontal"><ul id="yw1" class="yiiPager"><li class="refresh hidden"><a href="/zurmo/app/index.php/home/defaultPortlet/myListDetails?portletId=2">refresh</a></li></ul></div><div class="list-preloader"><span class="z-spinner"></span></div><div class="keys" style="display:none" title="/zurmo/app/index.php/home/default"></div>
</div>
</div></div>
</div>
</li>
<li class="juiportlet-widget TasksMyListView type-tasks" id="HomeDashboard1_3">
<div class="juiportlet-widget-head">
<h3>My Open Tasks</h3><ul class="options-menu edit-portlet-menu nav">
<li class="parent last"><a href="javascript:void(0);"><span></span></a>
<ul>
<li><a class="edit" id="HomeDashboard1_3_EditLink" href="#"><span>Configure Portlet</span></a></li>
<li class="last"><a class="remove-portlet" href="#"><span>Remove Portlet</span></a></li>
</ul>
</li>
</ul>
</div>
<div class="juiportlet-widget-content"  >
<div class="TasksMyListView SecuredMyListView MyListView ListView ModelView ConfigurableMetadataView MetadataView"><div class="cgrid-view type-tasks" id="list-viewHomeDashboard1_3">

<span class="empty"><span class="icon-empty"></span>No tasks found</span>
<div class="pager horizontal"><ul id="yw2" class="yiiPager"><li class="refresh hidden"><a href="/zurmo/app/index.php/home/defaultPortlet/myListDetails?portletId=3">refresh</a></li></ul></div><div class="list-preloader"><span class="z-spinner"></span></div><div class="keys" style="display:none" title="/zurmo/app/index.php/home/default"></div>
</div>
</div>
</div>
</li>
<li class="juiportlet-widget OpportunitiesBySourceChartView type-opportunities" id="HomeDashboard1_4">
<div class="juiportlet-widget-head">
<h3>Opportunities By Lead Source</h3><ul class="options-menu edit-portlet-menu nav">
<li class="parent last"><a href="javascript:void(0);"><span></span></a>
<ul>
<li><a class="edit" id="HomeDashboard1_4_EditLink" href="#"><span>Configure Portlet</span></a></li>
<li class="last"><a class="remove-portlet" href="#"><span>Remove Portlet</span></a></li>
</ul>
</li>
</ul>
</div>
<div class="juiportlet-widget-content"  >
<div class="OpportunitiesBySourceChartView ChartView ConfigurableMetadataView MetadataView"><div id='chartContainerHomeDashboard1_4' style='width: 100%; height: 400px;'></div></div>
</div>
</li>
</ul>
<ul class="juiportlet-columns-HomeDashboard1 juiportlet-widget-column2 juiportlet-column juiportlet-column-split-even-2">
<li class="juiportlet-widget AllSocialItemsForPortletView type-socialItems" id="HomeDashboard1_5">
<div class="juiportlet-widget-head">
<h3>What's going on?</h3><ul class="options-menu edit-portlet-menu nav">
<li class="parent last"><a href="javascript:void(0);"><span></span></a>
<ul>
<li class="last"><a class="remove-portlet" href="#"><span>Remove Portlet</span></a></li>
</ul>
</li>
</ul>
</div>
<div class="juiportlet-widget-content"  >
<div id="AllSocialItemsForPortletView" class="SocialItemsForPortletView ConfigurableMetadataView MetadataView"><div class="SocialItemInlineEditView InlineEditView EditView DetailsView ModelView ConfigurableMetadataView MetadataView"><div class="wide form"><form id="social-item-inline-edit-form" action="/zurmo/app/index.php/socialItems/default/inlineCreateSave?redirectUrl=%2Fzurmo%2Fapp%2Findex.php%2Fhome%2FdefaultPortlet%2FmyListDetails%3FportletId%3D5%26uniqueLayoutId%3DHomeDashboard1_5" method="post">
<div style="display:none"><input type="hidden" value="53a68de046f4818cf4ce2afe7394e014015d46c7" name="YII_CSRF_TOKEN" /></div><div class="left-column full-width"><div class="panel"><table class="form-fields"><colgroup><col class="col-0" /></colgroup><tbody><tr><td colspan="1"><textarea id="SocialItem_description" name="SocialItem[description]" rows="2" cols="50"></textarea><div class="errorMessage" id="SocialItem_description_em_" style="display:none"></div></td></tr><tr><td colspan="1"><div class="file-upload-box"><div id="fileUploadSocialItem"><div class="fileupload-buttonbar clearfix"><div class="addfileinput-button"><span>Y</span><strong class="add-label">Add Files</strong><input id="SocialItem_files" type="file" name="SocialItem_files" /></div></div><div class="fileupload-content"><table class="files"><tbody></tbody></table></div></div><script id="template-upload" type="text/x-jquery-tmpl">
    <tr class="template-upload{{if error}} ui-state-error{{/if}}">
        <td class="name">
            <span class="z-spinner"></span>
            ${name} <span class="file-size">(${sizef})</span>
            {{if error}}
                <span class="upload-error">${error}</span>
            {{else}}
                <span class="upload-actions cancel">
                    <button class="cancel" title="Cancel"><span>Cancel</span></button>
                </span>
            {{/if}}
        </td>
    </tr>
</script><script id="template-download" type="text/x-jquery-tmpl">
    <tr class="template-download{{if error}} ui-state-error{{/if}}">
        {{if error}}
            <td class="error" colspan="4">${error}</td>
        {{else}}
            <td class="name">
                ${name} <span class="file-size">(${size})</span>
                <span class="upload-actions delete">
                    <button class="icon-delete" title="Remove" data-url="/zurmo/app/index.php/zurmo/fileModel/delete?id=${id}"><span><!--Delete--><span></button>
                </span>
                <input name="filesIds[]" type="hidden" value="${id}"/>
            </td>
        {{/if}}
    </tr>
</script></div><a href="#" class="show-file-upload-box" onclick="jQuery(this).hide().prev().show().find('input[type=file]').click(); return false;">Add Files</a></td></tr></tbody></table></div></div><div class="view-toolbar-container clearfix"><div class="form-toolbar clearfix"><a id="savePost" name="savePost" class="attachLoading z-button" onclick="jQuery.yii.submitForm(this, &#039;&#039;, {&#039;save&#039;:&#039;save&#039;}); return false;" href="#"><span class="z-spinner"></span><span class="z-icon"></span><span class="z-label">Comment</span></a></div></div></form><div id="modalContainer-social-item-inline-edit-form"></div></div></div><div class="SocialItemsListView ListView ModelView ConfigurableMetadataView MetadataView"><div class="cgrid-view type-socialItems" id="list-viewAllSocialItemsForPortletView">

<span class="empty"><span class="icon-empty"></span></span>
<div class="pager vertical"></div><div class="list-preloader"><span class="z-spinner"></span></div><div class="keys" style="display:none" title="/zurmo/app/index.php/home/default"></div>
</div>
</div></div>
</div>
</li>
<li class="juiportlet-widget MyMissionsForPortletView type-missions" id="HomeDashboard1_6">
<div class="juiportlet-widget-head">
<h3>My Missions</h3><ul class="options-menu edit-portlet-menu nav">
<li class="parent last"><a href="javascript:void(0);"><span></span></a>
<ul>
<li class="last"><a class="remove-portlet" href="#"><span>Remove Portlet</span></a></li>
</ul>
</li>
</ul>
</div>
<div class="juiportlet-widget-content"  >
<div id="MyMissionsForPortletView" class="ConfigurableMetadataView MetadataView"><div class="MissionsPortletListView MissionsListView SecuredListView ListView ModelView ConfigurableMetadataView MetadataView"><form id="missions-list-configuration-form" action="/zurmo/app/index.php/home/default" method="post">
<div style="display:none"><input type="hidden" value="53a68de046f4818cf4ce2afe7394e014015d46c7" name="YII_CSRF_TOKEN" /></div><div class="filter-portlet-model-bar"><div id="MissionsListConfigurationForm_type_area"><input id="ytMissionsListConfigurationForm_type" type="hidden" value="" name="MissionsListConfigurationForm[type]" /><input id="MissionsListConfigurationForm_type_0" value="1" type="radio" name="MissionsListConfigurationForm[type]" /><label for="MissionsListConfigurationForm_type_0">Created</label><input id="MissionsListConfigurationForm_type_1" value="2" type="radio" name="MissionsListConfigurationForm[type]" /><label for="MissionsListConfigurationForm_type_1">Available</label><input id="MissionsListConfigurationForm_type_2" value="3" checked="checked" type="radio" name="MissionsListConfigurationForm[type]" /><label for="MissionsListConfigurationForm_type_2">My Missions</label></div></div>
</form><div class="cgrid-view type-missions" id="list-viewMyMissionsForPortletView">

<table class="items">
<tbody>
<tr><td colspan="1" class="empty"><span class="empty"><span class="icon-empty"></span>No results found</span></td></tr>
</tbody>
</table>
<div class="pager horizontal"><ul id="yw4" class="yiiPager"><li class="refresh hidden"><a href="/zurmo/app/index.php/home/defaultPortlet/myListDetails?portletId=6">refresh</a></li></ul></div><div class="list-preloader"><span class="z-spinner"></span></div><div class="keys" style="display:none" title="/zurmo/app/index.php/home/default"></div>
</div>
</div></div>
</div>
</li>
<li class="juiportlet-widget OpportunitiesByStageChartView type-opportunities" id="HomeDashboard1_7">
<div class="juiportlet-widget-head">
<h3>Opportunities By Sales Stage</h3><ul class="options-menu edit-portlet-menu nav">
<li class="parent last"><a href="javascript:void(0);"><span></span></a>
<ul>
<li><a class="edit" id="HomeDashboard1_7_EditLink" href="#"><span>Configure Portlet</span></a></li>
<li class="last"><a class="remove-portlet" href="#"><span>Remove Portlet</span></a></li>
</ul>
</li>
</ul>
</div>
<div class="juiportlet-widget-content"  >
<div class="OpportunitiesByStageChartView ChartView ConfigurableMetadataView MetadataView"><div id='chartContainerHomeDashboard1_7' style='width: 100%; height: 400px;'></div></div>
</div>
</li>
</ul>
</div></div></div><div id="FlashMessageView"><div id = "FlashMessageBar"></div></div></div><div id="ModalContainerView"><div id="modalContainer"></div></div><div id="ModalGameNotificationContainerView"></div><div id="GameCoinContainerView"></div><div id="FooterView"><a href="http://www.zurmo.com" id="credit-link" class="clearfix"><span>Copyright &#169; Zurmo Inc., 2013. All rights reserved.</span></a><div class="ui-chooser"><a class="icon-mobile" href="/zurmo/app/index.php/zurmo/default/userInterface?userInterface=Mobile"><span>Show Mobile</span></a><a class="icon-desktop active" href="/zurmo/app/index.php/zurmo/default/userInterface?userInterface=Desktop"><span>Show Full</span></a></div></div></div></div></div><script type="text/javascript">
/*<![CDATA[*/
function closeGamificationDashboard(){
                           $('#UserGameDashboardView').remove();
                           $('body').removeClass('gd-dashboard-active');
                           $('#header-game-dashboard-link').html('∂').toggleClass('highlighted');
                       }

                function closeOpenTaskByCheckBoxClick(checkboxId, modelId)
                {
                    if ($('#' + checkboxId).attr('checked') == 'checked')
                    {
                        $('#' + checkboxId).attr('disabled', true);
                        $('#' + checkboxId).parent().addClass('c_on');
                        $('#' + checkboxId).parent().addClass('disabled');
                        $('#' + checkboxId).parentsUntil('tr').parent().children().css('text-decoration', 'line-through');
                        $.ajax({
                            url : '/zurmo/app/index.php/tasks/default/closeTask?id=' + modelId,
                            type : 'GET',
                            dataType : 'json',
                            success : function(data)
                            {
                                //find if there is a latest activities portlet
                                $('.LatestActivitiesForPortletView').each(function(){
                                    $(this).find('.pager').find('.refresh').find('a').click();
                                });
                            },
                            error : function()
                            {
                                //todo: error call
                            }
                        });
                    }
                }
            
jQuery(function($) {

                    jQuery("body").ajaxComplete(
                        function(event, request, options)
                        {
                            if (request.responseText == "sessionTimeout")
                            {
                                $.cookie("sessionTimeoutCookie", 1,
                                        {
                                            expires : 1,
                                            path:  "/"
                                        });
                                window.location.reload(true);
                            }
                        }
                    );
                
$('#go-to-dashboard-link, #close-game-notification-link').click(function(event){
                           event.preventDefault();
                           $('#game-notification').fadeOut(300, function(){
                               $('#game-notification').remove();
                           });
                       });
                       $('.gd-dashboard-active').on('click', function(){
                           if($('#UserGameDashboardView').length){
                               closeGamificationDashboard();
                           }
                           return false;
                       });
$('body').on('click', '#header-game-dashboard-link', function(){jQuery.ajax({'beforeSend':function(){
                    if($("#UserGameDashboardView").length){
                        closeGamificationDashboard();
                        return false;
                    }
                    $("body").addClass("gd-dashboard-active");
                    $("#header-game-dashboard-link").html("‰").toggleClass("highlighted");
                },'success':function(data){$("#FooterView").after(data);},'url':'/zurmo/app/index.php/users/default/gameDashboard?id=1','cache':false});return false;});
  $(".nav li").hover(
    function () {
      if ($(this).hasClass("parent")) {
        $(this).addClass("over");
      }
    },
    function () {
      $(this).removeClass("over");
    }
  );

$("#globalSearchScope").bind("multiselectclick", function(event, ui){
                            if ($("#globalSearchScope").multiselect("widget").find(":checkbox:checked").length == 0)
                            {
                                $("#globalSearchScope").multiselect("widget").find(":checkbox").each(function(){
                                    if (this.value == "All" && !this.checked)
                                    {
                                        this.click();
                                    }
                                });
                            }
                            if (ui.value == "All" && ui.checked)
                            {
                                $("#globalSearchScope").multiselect("widget").find(":checkbox").each(function(){
                                    if (this.value != "All" && this.checked)
                                    {
                                        this.click();
                                    }
                                });
                            }
                            else if (ui.value != "All" && ui.checked)
                            {
                                $("#globalSearchScope").multiselect("widget").find(":checkbox").each(function(){
                                    if (this.value == "All" && this.checked)
                                    {
                                        this.click();
                                    }
                                });
                            }
                        });
                       
$('#globalSearchScope').multiselect({'selectedText':'','noneSelectedText':'','header':false,'position':{'my':'right top','at':'right bottom'}}); $(this).setupCheckboxStyling($('#globalSearchScope').parent())
$("#globalSearchInput").bind("focus", function(event, ui){
                            $("#globalSearchInput").autocomplete("option", "source", "/zurmo/app/index.php/zurmo/default/globalSearchAutoComplete?" + $.param($("#globalSearchScope").serializeArray()));
                        });
                       
jQuery('#globalSearchInput').autocomplete({'select': function(event, ui) {if (ui.item.href.length > 0){window.location = ui.item.href;} return false;},'search': function(event, ui) { $(this).makeOrRemoveTogglableSpinner(true, "#app-search") },'open': function(event, ui) { $(this).makeOrRemoveTogglableSpinner(false, "#app-search") },'position':{'my':'right top','at':'right bottom'},'source':'/zurmo/app/index.php/zurmo/default/globalSearchAutoComplete'});
 $("#globalSearchInput").data( "autocomplete" )._renderItem = function( ul, item ) {
                            return $( "<li></li>" ).data( "item.autocomplete", item )
                                    .append( "<a><span class=" + item.iconClass + "></span><span>" + item.label + "</span></a>" )
                                    .appendTo( ul );
                        };
$('body').on('click', '#yt0', function(){jQuery.ajax({'beforeSend':function(){
                jQuery('#modalContainer').html('');
                $(this).makeLargeLoadingSpinner(true, '#modalContainer');
                window.scrollTo(0, 0);
                jQuery('#modalContainer').dialog({
                    'title' : 'Create Task',
                    'autoOpen' : true,
                    'modal' : true,
                    'position' : 'center top+25',
                    'dialogClass' : 'task-dialog',
                    'height' : 'auto',
                    'open': function( event, ui )  { jQuery('#modalContainer').parent().addClass('openingModal'); },
                    'close': function( event, ui ) { jQuery('#modalContainer').parent().removeClass('openingModal');
                                                     $('#modalContainer').dialog('destroy');
                                                     
                                                     }
                });
                return true;
            },'url':'/zurmo/app/index.php/tasks/default/modalCreate?modalId=modalContainer','cache':false,'success':function(html){jQuery("#modalContainer").html(html)}});return false;});
$('body').on('click', '#AddPortletLink', function(){jQuery.ajax({'beforeSend':function(){
                jQuery('#modalContainer').html('');
                $(this).makeLargeLoadingSpinner(true, '#modalContainer');
                window.scrollTo(0, 0);
                jQuery('#modalContainer').dialog({
                    'title' : 'Add Portlet',
                    'autoOpen' : true,
                    'modal' : true,
                    'position' : 'center top+25',
                    'dialogClass' : '',
                    'height' : 'auto',
                    'open': function( event, ui )  { jQuery('#modalContainer').parent().addClass('openingModal'); },
                    'close': function( event, ui ) { jQuery('#modalContainer').parent().removeClass('openingModal');
                                                     $('#modalContainer').dialog('destroy');
                                                     
                                                     }
                });
                return true;
            },'url':'/zurmo/app/index.php/home/defaultPortlet/AddList?uniqueLayoutId=HomeDashboard1&dashboardId=1','cache':false,'success':function(html){jQuery("#modalContainer").html(html)}});return false;});
var calendarEvents = {}; 

jQuery('#calendarHomeDashboard1_1_container').datepicker({'dateFormat':'m/d/y','onChangeMonthYear':function(year, month, inst) {
                //Call to render new events
                $.ajax({
                    url      : $.param.querystring('/zurmo/app/index.php/home/defaultPortlet/myListViewAction?action=renderMonthEvents&portletId=1&uniqueLayoutId=HomeDashboard1_1', '&month=' + month + '&year=' + year),
                    async    : false,
                    type     : 'GET',
                    dataType : 'html',
                    success  : function(data)
                    {
                        eval(data);
                        //Since the home page for some reason cannot render this properly in beforeShow, we are using a trick.
                        setTimeout('addSpansToDatesOnCalendar("' + inst.id + '")', 100);
                    },
                    error : function()
                    {
                        //todo: error call
                    }
                });
            },'onSelect':function(dateText, inst) {
                $.ajax({
                    url      : $.param.querystring('/zurmo/app/index.php/meetings/default/daysMeetingsFromCalendarModalList?redirectUrl=%2Fzurmo%2Fapp%2Findex.php%2Fhome%2Fdefault&ownerOnly=1', '&stringTime=' + $('#calendarSelectedDateHomeDashboard1_1').val()),
                    async    : false,
                    type     : 'GET',
                    'beforeSend' : function(){
                                        jQuery('#modalContainer').html('');
                                        $(this).makeLargeLoadingSpinner(true, '#modalContainer');
                                        jQuery('#modalContainer').dialog({'title': dateText,
                                                                          'autoOpen':true,
                                                                          'modal': true,
                                                                          'height': 'auto',
                                                                          'position': 'center',
                                                                          'width':600}); return true;},
                    success  : function(data)
                    {
                        jQuery('#modalContainer').html(data)
                        //Since the home page for some reason cannot render this properly in beforeShow, we are using a trick.
                        setTimeout('addSpansToDatesOnCalendar("' + inst.id + '")', 100);
                    },
                    error : function()
                    {
                        //todo: error call
                    }
                });
            },'altFormat':'yy-mm-dd','altField':'#calendarSelectedDateHomeDashboard1_1','beforeShowDay':function(date) {
                var event = calendarEvents[date];
                if (event) {
                    return [true, event.className, event.text];
                }
                else {
                    return [true, '', ''];
                }
            }});addSpansToDatesOnCalendar("calendarHomeDashboard1_1_container");

            $('#LatestActivitiesConfigurationForm_rollup_area').buttonset();
            $('#LatestActivitiesConfigurationForm_ownedByFilter_area').buttonset();
            $('#LatestActivitiesConfigurationForm_filteredByModelName_area').buttonset();
            $('#LatestActivitiesConfigurationForm_rollup_area').change(function()
                {
                    jQuery.ajax({'type':'GET','data':$("#latest-activity-configuration-form").serialize(),'url':$.param.querystring("/zurmo/app/index.php/home/defaultPortlet/myListDetails?portletId=2&uniqueLayoutId=HomeDashboard1_2", "AllLatestActivitiesForPortletView_page=1"),'beforeSend':function(){$(this).makeSmallLoadingSpinner(true, "#list-viewAllLatestActivitiesForPortletView"); $("#latest-activity-configuration-form").parent().children(".cgrid-view").addClass("loading");},'complete':function()
                    {
                                        $("#latest-activity-configuration-form").parent().children(".cgrid-view").removeClass("loading");
                                        $("#filter-portlet-model-bar-AllLatestActivitiesForPortletView").show();
                    },'cache':false,'success':function(html){jQuery("#AllLatestActivitiesForPortletView").html(html)}});
                }
            );
            $('#LatestActivitiesConfigurationForm_ownedByFilter_area').change(function()
                {
                    jQuery.ajax({'type':'GET','data':$("#latest-activity-configuration-form").serialize(),'url':$.param.querystring("/zurmo/app/index.php/home/defaultPortlet/myListDetails?portletId=2&uniqueLayoutId=HomeDashboard1_2", "AllLatestActivitiesForPortletView_page=1"),'beforeSend':function(){$(this).makeSmallLoadingSpinner(true, "#list-viewAllLatestActivitiesForPortletView"); $("#latest-activity-configuration-form").parent().children(".cgrid-view").addClass("loading");},'complete':function()
                    {
                                        $("#latest-activity-configuration-form").parent().children(".cgrid-view").removeClass("loading");
                                        $("#filter-portlet-model-bar-AllLatestActivitiesForPortletView").show();
                    },'cache':false,'success':function(html){jQuery("#AllLatestActivitiesForPortletView").html(html)}});
                }
            );
            $('#LatestActivitiesConfigurationForm_filteredByModelName_area').change(function()
                {
                    jQuery.ajax({'type':'GET','data':$("#latest-activity-configuration-form").serialize(),'url':$.param.querystring("/zurmo/app/index.php/home/defaultPortlet/myListDetails?portletId=2&uniqueLayoutId=HomeDashboard1_2", "AllLatestActivitiesForPortletView_page=1"),'beforeSend':function(){$(this).makeSmallLoadingSpinner(true, "#list-viewAllLatestActivitiesForPortletView"); $("#latest-activity-configuration-form").parent().children(".cgrid-view").addClass("loading");},'complete':function()
                    {
                                        $("#latest-activity-configuration-form").parent().children(".cgrid-view").removeClass("loading");
                                        $("#filter-portlet-model-bar-AllLatestActivitiesForPortletView").show();
                    },'cache':false,'success':function(html){jQuery("#AllLatestActivitiesForPortletView").html(html)}});
                }
            );
            $('#filter-latest-activities-link').click( function()
                {
                    $('#filter-portlet-model-bar-AllLatestActivitiesForPortletView').toggle();
                    return false;
                }
            );
            
$(document).on('click', '#list-viewAllLatestActivitiesForPortletView .task-kanban-detail-link', function()
                          {
                            var id = $(this).attr('id');
                            var idParts = id.split('-');
                            var taskId = parseInt(idParts[1]);
                            $.ajax(
                            {
                                'type' : 'GET',
                                'url'  : '/zurmo/app/index.php/tasks/default/modalDetails' + '?id=' + taskId,
                                'beforeSend' : function(){
                jQuery('#modalContainer').html('');
                $(this).makeLargeLoadingSpinner(true, '#modalContainer');
                window.scrollTo(0, 0);
                jQuery('#modalContainer').dialog({
                    'title' : 'Collaborate On This Task',
                    'autoOpen' : true,
                    'modal' : true,
                    'position' : 'center top+25',
                    'dialogClass' : 'task-dialog',
                    'height' : 'auto',
                    'open': function( event, ui )  { jQuery('#modalContainer').parent().addClass('openingModal'); },
                    'close': function( event, ui ) { jQuery('#modalContainer').parent().removeClass('openingModal');
                                                     $('#modalContainer').dialog('destroy');
                                                     $.fn.yiiGridView.update('list-viewAllLatestActivitiesForPortletView');
                                                     }
                });
                return true;
            },
                                'update'     : '#modalContainer',
                                'success': function(html){jQuery('#modalContainer').html(html)}
                            });
                          }
                        );
jQuery('#list-viewAllLatestActivitiesForPortletView').yiiGridView({'ajaxUpdate':['list-viewAllLatestActivitiesForPortletView'],'ajaxVar':'ajax','pagerClass':'pager horizontal','loadingClass':'loading','filterClass':'filters','tableClass':'items','selectableRows':0,'enableHistory':false,'updateSelector':'{page}, {sort}','filterSelector':'{filter}','pageVar':'AllLatestActivitiesForPortletView_page','beforeAjaxUpdate':function(id, options) { $(this).makeSmallLoadingSpinner(true, "#" + id); },'afterAjaxUpdate':function(id, data) {
                        processAjaxSuccessError(id, data);
                    }});
jQuery('#list-viewHomeDashboard1_3').yiiGridView({'ajaxUpdate':['list-viewHomeDashboard1_3'],'ajaxVar':'ajax','pagerClass':'pager horizontal','loadingClass':'loading','filterClass':'filters','tableClass':'items','selectableRows':0,'enableHistory':false,'updateSelector':'{page}, {sort}','filterSelector':'{filter}','pageVar':'Task_page','beforeAjaxUpdate':function(id, options) { $(this).makeSmallLoadingSpinner(true, "#" + id); },'afterAjaxUpdate':function(id, data) {
                        processAjaxSuccessError(id, data);
                    }});
$(document).on('click', '#list-viewHomeDashboard1_3 .task-kanban-detail-link', function()
                          {
                            var id = $(this).attr('id');
                            var idParts = id.split('-');
                            var taskId = parseInt(idParts[1]);
                            $.ajax(
                            {
                                'type' : 'GET',
                                'url'  : '/zurmo/app/index.php/tasks/default/modalDetails' + '?id=' + taskId,
                                'beforeSend' : function(){
                jQuery('#modalContainer').html('');
                $(this).makeLargeLoadingSpinner(true, '#modalContainer');
                window.scrollTo(0, 0);
                jQuery('#modalContainer').dialog({
                    'title' : 'Collaborate On This Task',
                    'autoOpen' : true,
                    'modal' : true,
                    'position' : 'center top+25',
                    'dialogClass' : 'task-dialog',
                    'height' : 'auto',
                    'open': function( event, ui )  { jQuery('#modalContainer').parent().addClass('openingModal'); },
                    'close': function( event, ui ) { jQuery('#modalContainer').parent().removeClass('openingModal');
                                                     $('#modalContainer').dialog('destroy');
                                                     $.fn.yiiGridView.update('list-viewHomeDashboard1_3');
                                                     }
                });
                return true;
            },
                                'update'     : '#modalContainer',
                                'success': function(html){jQuery('#modalContainer').html(html)}
                            });
                          }
                        );

                    $('#chartContainerHomeDashboard1_4').html('<span class="empty missing-chart">Not enough data to render chart</span>');
                
$(function () {
    'use strict';

    // Initialize the jQuery File Upload widget:
    $('#fileUploadSocialItem').fileupload({
        dataType: 'json',
        url: '/zurmo/app/index.php/zurmo/fileModel/upload?filesVariableName=SocialItem_files',
        autoUpload: true,
        sequentialUploads: true,
        maxFileSize: 1048576,
        add: function (e, data) {
            
            
            var that = $(this).data('fileupload');
            that._adjustMaxNumberOfFiles(-data.files.length);
            data.isAdjusted = true;
            data.isValidated = that._validate(data.files);
            data.context = that._renderUpload(data.files)
                .appendTo($(this).find('.files')).fadeIn(function () {
                    // Fix for IE7 and lower:
                    $(this).show();
                    $(this).makeOrRemoveTogglableSpinner(true, '#'+'fileUploadSocialItem');
                }).data('data', data);
            if ((that.options.autoUpload || data.autoUpload) &&
                    data.isValidated) {
                data.jqXHR = data.submit();
            }
        }
    });
    // Open download dialogs via iframes,
    // to prevent aborting current uploads:
    $('#fileUploadSocialItem .files a:not([target^=_blank])').live('click', function (e) {
        e.preventDefault();
        $('<iframe style="display:none;"></iframe>')
            .prop('src', this.href)
            .appendTo('body');
    });
    $('.fileupload-buttonbar').removeClass('ui-widget-header ui-corner-top');
    $('.fileupload-content').removeClass('ui-widget-content ui-corner-bottom');
    $('#fileUploadSocialItem').bind('fileuploaddestroy', function (e, data) {
            

    });
    $('#fileUploadSocialItem').bind('fileuploadalways', function (e, data) {
        if (data == undefined || data.result == undefined ||
          ((data.result[0] != undefined && data.result[0].error != undefined) || data.result.error != undefined))
        {
            setTimeout(function () {
               $('#social-item-inline-edit-form').find('.files > tbody').children(':last').fadeOut('slow', function() { $(this).remove();});
               
            }, 1000);
        }
    });
    //load existing files
    var existingFiles = [];
    var fu = $('#fileUploadSocialItem').data('fileupload');
    fu._adjustMaxNumberOfFiles(-existingFiles.length);
    fu._renderDownload(existingFiles)
        .appendTo($('#fileUploadSocialItem .files'))
        .fadeIn(function () {
            // Fix for IE7 and lower:
            $(this).show();
    });
});

$('#social-item-inline-edit-form').yiiactiveform({'validateOnSubmit':true,'validateOnChange':false,'beforeValidate':$(this).beforeValidateAction,'afterValidate':$(this).afterValidateAjaxAction,'afterValidateAjax':'jQuery.ajax({\'type\':\'POST\',\'data\':$(\"#social-item-inline-edit-form\").serialize(),\'url\':\'/zurmo/app/index.php/socialItems/default/inlineCreateSave?redirectUrl=%2Fzurmo%2Fapp%2Findex.php%2Fhome%2FdefaultPortlet%2FmyListDetails%3FportletId%3D5%26uniqueLayoutId%3DHomeDashboard1_5\',\'cache\':false,\'success\':function(html){jQuery(\"#AllSocialItemsForPortletView\").html(html)}});','attributes':[{'id':'SocialItem_description','inputID':'SocialItem_description','errorID':'SocialItem_description_em_','model':'SocialItem','name':'description','enableAjaxValidation':true}],'summaryID':'social-item-inline-edit-form_es_'});
jQuery('#list-viewAllSocialItemsForPortletView').yiiGridView({'ajaxUpdate':['list-viewAllSocialItemsForPortletView'],'ajaxVar':'ajax','pagerClass':'pager vertical','loadingClass':'loading','filterClass':'filters','tableClass':'items','selectableRows':0,'enableHistory':false,'updateSelector':'{page}, {sort}','filterSelector':'{filter}','pageVar':'SocialItem_page','beforeAjaxUpdate':function(id, options) { $(this).makeSmallLoadingSpinner(true, "#" + id); },'afterAjaxUpdate':function(id, data) {
                        processAjaxSuccessError(id, data);
                    }});

            $('#MissionsListConfigurationForm_type_area').buttonset();
            $('#MissionsListConfigurationForm_type_area').change(function()
                {
                    jQuery.ajax({'type':'GET','data':$("#missions-list-configuration-form").serialize(),'url':$.param.querystring("/zurmo/app/index.php/home/defaultPortlet/myListDetails?portletId=6&uniqueLayoutId=HomeDashboard1_6", "Mission_page=1"),'beforeSend':function(){$(this).makeSmallLoadingSpinner(true, "#list-viewMyMissionsForPortletView"); $("#missions-list-configuration-form").parent().children(".cgrid-view").addClass("loading");},'complete':function(){$("#missions-list-configuration-form").parent().children(".cgrid-view").removeClass("loading");},'cache':false,'success':function(html){jQuery("#MyMissionsForPortletView").html(html)}});
                }
            );
            
jQuery('#list-viewMyMissionsForPortletView').yiiGridView({'ajaxUpdate':['list-viewMyMissionsForPortletView'],'ajaxVar':'ajax','pagerClass':'pager horizontal','loadingClass':'loading','filterClass':'filters','tableClass':'items','selectableRows':0,'enableHistory':false,'updateSelector':'{page}, {sort}','filterSelector':'{filter}','pageVar':'Mission_page','beforeAjaxUpdate':function(id, options) { $(this).makeSmallLoadingSpinner(true, "#" + id); },'afterAjaxUpdate':function(id, data) {
                        processAjaxSuccessError(id, data);
                    }});

                    $('#chartContainerHomeDashboard1_7').html('<span class="empty missing-chart">Not enough data to render chart</span>');
                
juiPortlets.init('HomeDashboard1','home', '/zurmo/app/index.php/home/defaultPortlet/SaveLayout', 'YII_CSRF_TOKEN', '53a68de046f4818cf4ce2afe7394e014015d46c7', '.juiportlet-columns-HomeDashboard1', '1', '1', 'This portlet will be removed, ok?');
$('body').on('click', '#HomeDashboard1_3_EditLink', function(){jQuery.ajax({'beforeSend':function(){
                jQuery('#modalContainer').html('');
                $(this).makeLargeLoadingSpinner(true, '#modalContainer');
                window.scrollTo(0, 0);
                jQuery('#modalContainer').dialog({
                    'title' : 'Edit Portlet',
                    'autoOpen' : true,
                    'modal' : true,
                    'position' : 'center top+25',
                    'dialogClass' : '',
                    'height' : 'auto',
                    'open': function( event, ui )  { jQuery('#modalContainer').parent().addClass('openingModal'); },
                    'close': function( event, ui ) { jQuery('#modalContainer').parent().removeClass('openingModal');
                                                     $('#modalContainer').dialog('destroy');
                                                     
                                                     }
                });
                return true;
            },'url':'/zurmo/app/index.php/home/defaultPortlet/ModalConfigEdit?uniqueLayoutId=HomeDashboard1&portletId=3&','cache':false,'success':function(html){jQuery("#modalContainer").html(html)}});return false;});
$('body').on('click', '#HomeDashboard1_4_EditLink', function(){jQuery.ajax({'beforeSend':function(){
                jQuery('#modalContainer').html('');
                $(this).makeLargeLoadingSpinner(true, '#modalContainer');
                window.scrollTo(0, 0);
                jQuery('#modalContainer').dialog({
                    'title' : 'Edit Portlet',
                    'autoOpen' : true,
                    'modal' : true,
                    'position' : 'center top+25',
                    'dialogClass' : '',
                    'height' : 'auto',
                    'open': function( event, ui )  { jQuery('#modalContainer').parent().addClass('openingModal'); },
                    'close': function( event, ui ) { jQuery('#modalContainer').parent().removeClass('openingModal');
                                                     $('#modalContainer').dialog('destroy');
                                                     
                                                     }
                });
                return true;
            },'url':'/zurmo/app/index.php/home/defaultPortlet/ModalConfigEdit?uniqueLayoutId=HomeDashboard1&portletId=4&','cache':false,'success':function(html){jQuery("#modalContainer").html(html)}});return false;});
$('body').on('click', '#HomeDashboard1_7_EditLink', function(){jQuery.ajax({'beforeSend':function(){
                jQuery('#modalContainer').html('');
                $(this).makeLargeLoadingSpinner(true, '#modalContainer');
                window.scrollTo(0, 0);
                jQuery('#modalContainer').dialog({
                    'title' : 'Edit Portlet',
                    'autoOpen' : true,
                    'modal' : true,
                    'position' : 'center top+25',
                    'dialogClass' : '',
                    'height' : 'auto',
                    'open': function( event, ui )  { jQuery('#modalContainer').parent().addClass('openingModal'); },
                    'close': function( event, ui ) { jQuery('#modalContainer').parent().removeClass('openingModal');
                                                     $('#modalContainer').dialog('destroy');
                                                     
                                                     }
                });
                return true;
            },'url':'/zurmo/app/index.php/home/defaultPortlet/ModalConfigEdit?uniqueLayoutId=HomeDashboard1&portletId=7&','cache':false,'success':function(html){jQuery("#modalContainer").html(html)}});return false;});
});
/*]]>*/
</script>
</body>